<?php
if(!defined('IN_DISCUZ')) {exit('Access Denied');}



if($_G['gp_del']==1){
	$bindConnect = DB::query("SELECT * FROM ".DB::table(renren_connect)." where dz_uid=".$_G['gp_uid']);
	while($data = DB::fetch($bindConnect)){
		if($data[tag])
		{
			$dzUid = DB::result_first("SELECT dz_uid FROM ".DB::table(renren_connect)." where tag=0 and rr_uid=".$data[rr_uid]);
			if($dzUid)
			{
				loaducenter();
				uc_user_delete($dzUid);
				require_once libfile('function/delete');
				$numdeleted = deletemember($dzUid, 0);
				DB::delete('renren_connect',array('dz_uid'=>$dzUid));
			}
			DB::delete('renren_connect',array('dz_uid'=>$_G['gp_uid']));

		}
		else
		{
			DB::delete('renren_connect',array('dz_uid'=>$_G['gp_uid']));
			loaducenter();
			uc_user_delete($_G['gp_uid']);
			require_once libfile('function/delete');
			$numdeleted = deletemember($_G['gp_uid'], 0);
		}
	}
}

$i=1;
$query = DB::query("SELECT * FROM ".DB::table(renren_connect));
while($data = DB::fetch($query)){

$list[$i][name]=DB::result_first("SELECT username FROM ".DB::table(common_member)." where uid=$data[dz_uid]");
$list[$i][rr_uid]=$data[rr_uid];
$list[$i][dz_uid]=$data[dz_uid];
$list[$i][tag]=$data[tag];
$list[$i][times]=$data[bind_time];
$i++;
}

include template('renren:list');

?>